<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::get('test','TestController@index')->name('test');

//后台登录
Route::get('admin/login','Admin\LoginController@showLoginForm')->name('admin.login');
Route::post('admin/login','Admin\LoginController@login')->name('admin.login');


Route::group(
    [
        'namespace' => 'Admin',
        'middleware' => 'auth.admin',
        'prefix' => 'admin',
        'as' => 'admin.',
    ],
    function(){
        // 登出
        Route::get('logout', 'LoginController@logout')->name('logout');
        // 后台主页面
        Route::get('home', 'HomeController@index')->name('home');
        // 后台欢迎页
        Route::get('welcome', 'HomeController@welcome')->name('home.welcome');

        //基本资料
        Route::get('person', 'HomeController@person')->name('home.person');
        //更改密码
        Route::put('person', 'HomeController@doChangePassword')->name('home.doChange');


        //栏目列表
        Route::get('categories', 'CategoriesController@index')->name('categories.index');

        //内容列表
        Route::get('contents', 'ContentController@index')->name('contents');

    });
